System Defined Properties

The following is valid for both predefined and user defined System Properties.

 

Object GetSystemProperty(propertyName: string);

Returns the value of a system property

Parameters

NameTypeDescription
propertyNameStringThe name of the property to retrieve. (as it appears in the Project Explorer)

Return Value Object

An object that represents the current value of the system property requested

void SetSystemProperty(propertyName: string, value: object);

Sets the value of a system property specified within the first parameter

Parameters

NameTypeDescription
propertyNameStringThe name of the property to set (as it appears in the Project Explorer)
valueObjectThe value to set the property to

Return Value - void.

Note – Only new system defined system properties can be set, calling this function with a pre-defined system property name has no effect.

void SubscribeToSystemPropertyChange(propertyName: string, callbackName: string);

Subscribes to event callback for changes of a component System defined property

Parameters

NameTypeDescription
PropertyNameStringThe name of the property to subscribe to
callbackNameStringThe name of the callback function

Return Value - void.

 

Callback definition: void xxxxxxxxxxxxx(property, value)

NameTypeDescription
propertyobjectThe name of the property that changed.
valueobjectThe new value of the property

void UnSubscribeToSystemPropertyChange(property: string);

Unsubscribe to an event callback for changes of a component system defined property

Parameters

NameTypeDescription
propertyStringThe name of the property to unsubscribe to

Return Value - void.

Example: Assumes a new System property called 'MySystemProperty' has been created.

SetSystemProperty("MySystemProperty",42);
SubscribeToSystemPropertyChange("MySystemProperty","OnSystemPropertyChanged");
...
function OnSystemPropertyChanged(property, value) {
  LogDebug("Property " + property + " value changed to "+ value);
  var newvalue = GetSystemProperty("MySystemProperty");
}